/* ************************************************************************

   Copyright:

   License:

   Authors:

 ************************************************************************ */

/* ************************************************************************

 #asset(ui_mov/*)
 #asset(qx/mobile/icon/${qx.mobile.platform}/*)
 #asset(qx/mobile/icon/common/*)

 ************************************************************************ */

/**
 * This is the main application class of your custom application "ui_mov"
 */
qx.Class.define("ui_mov.Application", {
	extend : qx.application.Mobile,

	/*
	 * ****************************************************************************
	 * MEMBERS
	 * ****************************************************************************
	 */

	members : {
		/**
		 * This method contains the initial application code and gets called
		 * during startup of the application
		 */
		main : function() {
			// Call super class
			this.base(arguments);

			// Enable logging in debug variant
			if (qx.core.Environment.get("qx.debug")) {
				// support native logging capabilities, e.g. Firebug for Firefox
				qx.log.appender.Native;
				// support additional cross-browser console. Press F7 to toggle
				// visibility
				qx.log.appender.Console;
			}

			/*
			 * -------------------------------------------------------------------------
			 * Below is your actual application code... Remove or edit the
			 * following code to create your application.
			 * -------------------------------------------------------------------------
			 */
			var pages = {};
			window['pages'] = pages;
			window.getSubscriptorId = function() {
				return Android.getIdS();
			};
			window.salir = function() {
				if (typeof (Android) != "undefined") {
					Android.salir();
				}
			};		
			var page1 = new ui_mov.views.welcome();
	
			pages.welcome = page1;
			var page2 = new ui_mov.views.intereses();
			pages.intereses = page2;
			var page3 = new ui_mov.views.noticias();
			pages.noticias = page3;
			var page4 = new ui_mov.views.noticiasroot();
			pages.noticiasroot = page4;
			var page5 = new ui_mov.views.noticia();
			pages.noticia = page5;
			pages.app = this;
			pages.busy = new qx.ui.mobile.dialog.Dialog(
					new qx.ui.mobile.dialog.BusyIndicator("Cargando..."));
			// Add the pages to the page manager.
			var manager = new qx.ui.mobile.page.Manager(false);
			manager.addDetail([ page1, page2, page3, page4, page5 ]);

			// Page1 will be shown at start
			page1.show();
		}
	}
});
